<?php 
class Check{
	//check the the str contain the upcase, low case and number. 
	public function check_up_low_number_exist($str){
		$ls = str_split($str,1);

		$degit = false;
		$up = false;
		$low = false;
		foreach ($ls as $c){
			if ($c >= 'a' && $c <= 'z'){
				$low = true;
			}else if ($c >= 'A' && $c <= 'Z'){
				$up = true;
			}else if($c >= '0' && $c <= '9'){
				$degit = true;
			}
		}
		return $low && $up && $degit;
	}
	
	public function check_str_len($str, $min, $max){
		if((utf8_strlen($str) < $min) || (utf8_strlen($str) > $max)){
			return false;
		}else{
			return true;
		}
	}
	
	public function check_cloud_region($region){
		$lists = array('qingcloud_pek2', 'qingcloud_gd1');
		
		foreach ($lists as $list){
			if($list === $region)
				return true;
		}
		return false;
	}
}

	
?>